<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Google Visualization API Sample</title>
  <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  <script type="text/javascript" src="/fusion_charts/Charts/FusionCharts.js"></script>
  <%= stylesheet_link_tag 'themes/base/jquery.ui.all' %>
  <%= javascript_include_tag 'jquery-1.4.4' %>
  <%= javascript_include_tag 'ui/jquery.ui.core' %>
  <%= javascript_include_tag 'ui/jquery.ui.widget' %>
  <%= javascript_include_tag 'ui/jquery.ui.datepicker' %>
  <script>
	$(function() {
		$( "#date" ).datepicker();
	});
  </script>
</head>



temp data: <%= @sql %>
<%= form_tag({:controller=>controller.controller_name, :action=>"index"}, :method=>"get") do %>
<table>
	<tr>
		<th colspan="3"><%= label_tag(:filter, "Filter") %></th>
	</tr>
	<tr>
		<td><label for="date">Date</label>			
		</td>
		<td><%= text_field_tag :date, params[:date] %>
		</td>
		<td></td>
	</tr>
	<tr>
		<td><label for="rfactor">Max R-factor</label>			
		</td>
		<td><%= text_field_tag :rfactor, params[:rfactor] %>
		</td>
		<td></td>
	</tr>
	<tr>
		<td><label for="duration">Min Duration</label>
		</td>
		<td><%= text_field_tag :duration, params[:duration] %> sec </td>
		<td></td>
	</tr>

	<tr>
		<td><label for="datacenter">Data center</label></td>
		<td><% DATA_CENTERS.each do |d| %>
			<%= check_box_tag("#{d}", 1, params[d]=="1") %> 
			<%= d %>	
			<% end %>
		</td>
		<td><%= submit_tag "Enter" %></td>
	</tr>
</table>
<% end %>
<!-- START Script Block for Chart r_factor -->
<% str_xml = render :file=>"cdr/vcb",:locals=>{:arr_data => @arr_data, :caption=>"R-Factor %s" % params[:date]} %>
		<div align="left" id="r_factorDiv">
				Chart.
		</div>
		<script type='text/javascript'>
				//Instantiate the Chart 
				if( FusionCharts.setCurrentRenderer ) FusionCharts.setCurrentRenderer("flash");
				var chart_r_factor=new FusionCharts('/fusion_charts/Charts/BoxAndWhisker2D.swf','r_factor','<%= @bridge_count * 60%>','400',0,0, '', '', '', '0', '0');
				<!-- Provide entire XML data using DataXML method -->
				chart_r_factor.setChartData('<%= raw(str_xml) %>','xml');
				//chart_r_factor.setXMLUrl("/Boxandwhiskers1.xml"); //Testing
				<!-- Finally render the chart. -->
				chart_r_factor.render('r_factorDiv');
		</script>
<!-- END Script Block for Chart r_factor -->







